package com.hejjon.core.enumer;

import lombok.Getter;

import java.util.*;
import java.util.stream.Collectors;

@Getter
public enum DatabaseTypeEnum {

    common("common", "一般业务库"),

    system("system", "系统内置库"),

    owned("owned", "私有库");

    private final String code;

    private final String name;

    DatabaseTypeEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }



    public static List<Map<String, String>> mapValues() {
        List<Map<String, String>> result = new ArrayList<>();
        for (DatabaseTypeEnum value : DatabaseTypeEnum.values()) {
            Map<String, String> map = new HashMap<>();
            map.put("code", value.code);
            map.put("name", value.name);
            result.add(map);
        }
        return result;
    }


}
